<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="dao.OrderDao" %>
<%@ page import="dao.UserDao" %>
<%@ page import="domain.Order" %><%--
  Created by IntelliJ IDEA.
  User: ThinkPad
  Date: 2021/12/26
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false"%>
<html>
<head>
    <title>后台-订单详情</title>
</head>
<body>
<%
    String oid = request.getParameter("oid");
    OrderDao dao = new OrderDao();
    UserDao dao1 = new UserDao();
    Order order = dao.search(oid);
    request.setAttribute("order",order);
    String name = dao1.search(order.getUid());
%>
<%@include file="headForRoot.jsp"%>
<br />
<table style="border: 1px solid #8ba7e3;text-align: center;width: 80%;margin-left: 10%;background-color: #eeeeee">
    <tr>
        <td style="text-align: center;background-color: #afd1f3" colSpan="4" height="26">
            <strong>订单详细信息</strong>
        </td>
    </tr>
    <tr>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">订单编号：</td>
        <td style="width: 42%">${order.id}</td>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">所属用户：</td>
        <td style="width: 22%"><%=name%></td>
    </tr>
    <tr>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">收件人：</td>
        <td style="width: 42%">${order.rname}</td>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">联系电话：</td>
        <td style="width: 22%">${order.rphone}</td>
    </tr>
    <tr>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">送货地址：</td>
        <td style="width: 82%" colspan="3">${order.raddr}</td>
    </tr>
    <tr>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">送货地址：</td>
        <td style="width: 82%" colspan="3">${order.raddr}</td>
    </tr>
    <tr>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">下单时间：</td>
        <td style="width: 82%" colspan="3">${order.ordertime}</td>
    </tr>
    <tr>
        <td style="width: 18%;text-align: center;background-color: #f5fafe">商品信息</td>
        <td style="width: 82%" colspan="3">
            <table style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 60%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word;margin-left: 20%">
                <tr style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">
                    <td style="width: 33%;text-align: center">序号</td>
                    <td style="width: 33%;text-align: center">商品编号</td>
                    <td style="width: 34%;text-align: center">购买数量</td>
                </tr>
                <c:forEach items="${order.items}" var="item" varStatus="vs">
                    <tr style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #eeeeee">
                        <td style="width: 33%;text-align: center">${vs.count}</td>
                        <td style="width: 33%;text-align: center">${item.pid}</td>
                        <td style="width: 34%;text-align: center">${item.count}</td>
                    </tr>
                </c:forEach>
            </table>
        </td>
    </tr>
</table>
<br />
<a href="${pageContext.request.contextPath}/log.jsp" style="margin-left: 48%;color: blue;font-weight: bold">&lt;返回</a>
<%@include file="tail.jsp"%>
</body>
</html>
